/*
 * loadimg.cpp
 *
 *  Created on: Oct 15, 2013
 *      Author: szendeja
 */

#include "opencv2/highgui/highgui.hpp"
#include "iostream"


using namespace cv;
using namespace std;

/* Typedefs */
typedef enum{
	SUCCESS,
	FAIL

}Return_Codes_t;

/* Prototypes  Functions*/
Return_Codes_t RC_fnLoad_IMG();

/* Compile with
g++ -I"C:\opencv\build\include" -L"C:\opencv\build\x86\mingw\lib" loadimg.cpp -lopencv_core246 -lopencv_highgui246 -o loadimage
*/
int main_2(){
	Return_Codes_t tReturn_status;
	tReturn_status = RC_fnLoad_IMG();
	if (tReturn_status == FAIL) {
		cout << "Error trying Show an Image" << endl;
	}

	return 0;
}

Return_Codes_t RC_fnLoad_IMG(){
	Mat img = imread("lena.png", CV_LOAD_IMAGE_COLOR);
	if (img.empty()){
		cout << "Cannot load image!" << endl;
		waitKey(60000);
	return FAIL;
	}

	namedWindow("Hello F*ck world", CV_WINDOW_AUTOSIZE);
	imshow("Hello F*ck world", img);
	waitKey(0);
	return SUCCESS;
}
